const mysql = require('mysql');
 
const connection = mysql.createConnection({
  host: 'localhost',	//数据库ip
  user: 'yourusername', 	//用户名
  password: 'yourpassword', 	//密码
  database: 'mydb', 	//数据库名
  port:3306 	//端口号
});
 
connection.connect(error => {
  if (error) throw error;
  console.log('Successfully connected to the database.');
});
 
module.exports = connection;